package com.gpagers.vtools;

import org.apache.velocity.tools.config.DefaultKey;

@DefaultKey("ueditorFmt") 
public class UeditorFmtVTL {
	
	/**
	 * 保存文件的时候注意格式化回车符
	 * @param content
	 * @return
	 */
	public String formateEnter(String content){
		if(content==null)
			return "";
		/*content = content.replaceAll("\n\r", "<br>&nbsp;&nbsp;");
		content = content.replaceAll("\r\n", "<br>&nbsp;&nbsp;");
		content = content.replaceAll("\r", "<br>&nbsp;&nbsp;");
		content = content.replaceAll("\n", "<br>&nbsp;&nbsp;");
		content = content.replaceAll("\t", "&nbsp;&nbsp;&nbsp;&nbsp;");
		content = content.replaceAll(" ", "&nbsp;");*/
		content = content.replaceAll("\n", "<br>&nbsp;&nbsp;");
		content = content.replaceAll("\r", "<br>&nbsp;&nbsp;");
		content = content.replaceAll("\"", "\\" + "\"");
		return content;
	}
}
